<template>
  <n-config-provider :theme-overrides="themeOverrides">
    <div class="loading-container" v-show="config.isLoading">
      <n-spin size="large" />
    </div>
  </n-config-provider>
</template>

<script setup lang="ts">
import { NConfigProvider } from 'naive-ui'
import { themeOverrides } from '@/theme/themeConfig'

withDefaults(
  defineProps<{
    config: {
      isLoading: boolean
    }
  }>(),
  {
    config: () => ({
      isLoading: false
    })
  }
)
</script>

<style scoped lang="scss">
.loading-container {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
</style>
